<?
$db_host = "localhost";
$db_db = "YOUR_ARMORY_DB_NAME";
$db_user = "YOUR_ARMORY_DB_USER";
$db_pass = "YOUR_DB_PASSWORD";

$cache_db_host = "localhost";
$cache_db_db = "YOUR_CACHE_DB";
$cache_db_user = "YOUR_CACHE_DB_USER";
$cache_db_pass = "YOUR_CACHE_DB_PASSWORD";

$_ARMORY_DB = false;
$_ARMORY_CACHE_DB = false;

function getDBConnection() {
	global $db_host, $db_db, $db_user, $db_pass;
	global $_ARMORY_DB;
	if($_ARMORY_DB) return $_ARMORY_DB;
	$_ARMORY_DB = mysql_pconnect($db_host, $db_user, $db_pass);
	mysql_select_db($db_db);
	return $_ARMORY_DB;
}

function getDBCacheConnection() {
	global $cache_db_host, $cache_db_db, $cache_db_user, $cache_db_pass;
	global $_ARMORY_CACHE_DB;
	if($_ARMORY_CACHE_DB) return $_ARMORY_CACHE_DB;
	$_ARMORY_CACHE_DB = mysql_pconnect($cache_db_host, $cache_db_user, $cache_db_pass);
	echo mysql_error();
	mysql_select_db($cache_db_db);
	return $_ARMORY_CACHE_DB;
}

?>
